home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / Controls.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  7.3 KB  |  394 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Controls.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__CONTROLS__') = 'UNDEFINED' THEN
  18. __CONTROLS__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24. ;        include 'ConditionalMacros.a'                                ;
  25.  
  26.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  27.     include 'Quickdraw.a'
  28.     ENDIF
  29. ;        include 'MixedMode.a'                                        ;
  30. ;        include 'QuickdrawText.a'                                    ;
  31.  
  32.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  33.     include 'Menus.a'
  34.     ENDIF
  35. ;        include 'Memory.a'                                            ;
  36. ;        include 'Events.a'                                            ;
  37. ;            include 'OSUtils.a'                                    ;
  38.     IF &TYPE('STRICT_CONTROLS') = 'UNDEFINED' THEN
  39.     STRICT_CONTROLS: SET 0
  40.     ENDIF
  41.  
  42. pushButProc                        EQU        0
  43. checkBoxProc                    EQU        1
  44. radioButProc                    EQU        2
  45. scrollBarProc                    EQU        16
  46. popupMenuProc                    EQU        1008
  47.  
  48. ;
  49. ; Standard System 7 CDEF variant codes for use in control creation API's
  50. ;
  51. useWFont                        EQU        8
  52.  
  53.     IF OLDROUTINENAMES  THEN
  54. inLabel                            EQU        1
  55. inMenu                            EQU        2
  56. inTriangle                        EQU        4
  57. inButton                        EQU        10
  58. inCheckBox                        EQU        11
  59. inUpButton                        EQU        20
  60. inDownButton                    EQU        21
  61. inPageUp                        EQU        22
  62. inPageDown                        EQU        23
  63. inThumb                            EQU        129
  64.  
  65.     ENDIF
  66. kNoHiliteControlPart            EQU        0
  67. kInLabelControlPart                EQU        1
  68. kInMenuControlPart                EQU        2
  69. kInTriangleControlPart            EQU        4
  70. kInButtonControlPart            EQU        10
  71. kInCheckBoxControlPart            EQU        11
  72. kInUpButtonControlPart            EQU        20
  73. kInDownButtonControlPart        EQU        21
  74. kInPageUpControlPart            EQU        22
  75. kInPageDownControlPart            EQU        23
  76. kInIndicatorControlPart            EQU        129
  77. kReservedControlPart            EQU        254
  78. kControlInactiveControlPart        EQU        255
  79.  
  80. ;
  81. ; System 7 Pop-up menu variants
  82. ;
  83. popupFixedWidth                    EQU        1 << 0
  84. popupVariableWidth                EQU        1 << 1
  85. popupUseAddResMenu                EQU        1 << 2
  86. popupUseWFont                    EQU        1 << 3
  87.  
  88. ;
  89. ; System 7 Pop-up menu title styles
  90. ;
  91. popupTitleBold                    EQU        1 << 8
  92. popupTitleItalic                EQU        1 << 9
  93. popupTitleUnderline                EQU        1 << 10
  94. popupTitleOutline                EQU        1 << 11
  95. popupTitleShadow                EQU        1 << 12
  96. popupTitleCondense                EQU        1 << 13
  97. popupTitleExtend                EQU        1 << 14
  98. popupTitleNoStyle                EQU        1 << 15
  99.  
  100. ;
  101. ; System 7 Pop-up menu label justifications
  102. ;
  103. popupTitleLeftJust                EQU        $00000000
  104. popupTitleCenterJust            EQU        $00000001
  105. popupTitleRightJust                EQU        $000000FF
  106.  
  107. ;
  108. ; Axis constraints for DragGrayRgn call
  109. ;
  110. noConstraint                    EQU        kNoConstraint
  111. hAxisOnly                        EQU        1
  112. vAxisOnly                        EQU        2
  113.  
  114. ;
  115. ; Messages for the control defproc
  116. ;
  117. drawCntl                        EQU        0
  118. testCntl                        EQU        1
  119. calcCRgns                        EQU        2
  120. initCntl                        EQU        3
  121. dispCntl                        EQU        4
  122. posCntl                            EQU        5
  123. thumbCntl                        EQU        6
  124. dragCntl                        EQU        7
  125. autoTrack                        EQU        8
  126. calcCntlRgn                        EQU        10
  127. calcThumbRgn                    EQU        11
  128. drawThumbOutline                EQU        12
  129.  
  130. ;
  131. ; Control color table part codes
  132. ;
  133. cFrameColor                        EQU        0
  134. cBodyColor                        EQU        1
  135. cTextColor                        EQU        2
  136. cThumbColor                        EQU        3
  137.  
  138.     IF STRICT_CONTROLS  THEN
  139.     ELSE
  140.     ENDIF
  141. ;
  142. ; Define the main entry point to the standard action proc pointer
  143. ;
  144. CtlCTab                 RECORD    0
  145. ccSeed                     ds.l    1
  146. ccRider                     ds.w    1
  147. ctSize                     ds.w    1
  148. ctTable                     ds.b    4 * ColorSpec
  149. sizeof                     EQU    40
  150.                         ENDR
  151.  
  152.     IF ¬ STRICT_CONTROLS  THEN
  153. ControlRecord             RECORD    0
  154. nextControl                 ds.l    1
  155. contrlOwner                 ds.l    1
  156. contrlRect                 ds        Rect
  157. contrlVis                 ds.b    1
  158. contrlHilite             ds.b    1
  159. contrlValue                 ds.w    1
  160. contrlMin                 ds.w    1
  161. contrlMax                 ds.w    1
  162. contrlDefProc             ds.l    1
  163. contrlData                 ds.l    1
  164. contrlAction             ds.l    1
  165. contrlRfCon                 ds.l    1
  166. contrlTitle                 ds.l    64
  167. sizeof                     EQU    296
  168.                         ENDR
  169.  
  170. ;
  171. ; Define private pop-up menu storage (hung off contrlData field in ControlRecord).
  172. ;
  173. PopupPrivateData         RECORD    0
  174. mHandle                     ds.l    1
  175. mID                         ds.w    1
  176. sizeof                     EQU    6
  177.                         ENDR
  178.  
  179.     ENDIF
  180. AuxCtlRec                 RECORD    0
  181. acNext                     ds.l    1
  182. acOwner                     ds.l    1
  183. acCTable                 ds.l    1
  184. acFlags                     ds.w    1
  185. acReserved                 ds.l    1
  186. acRefCon                 ds.l    1
  187. sizeof                     EQU    22
  188.                         ENDR
  189.  
  190. ;
  191. ; Structure used in __TrackControl() - See IM I-332
  192. ;
  193. IndicatorDragConstraint RECORD    0
  194. limitRect                 ds        Rect
  195. slopRect                 ds        Rect
  196. axis                     ds.w    1
  197. sizeof                     EQU    18
  198.                         ENDR
  199.  
  200.     IF GENERATING68K THEN
  201.         _NewControl:    OPWORD    $A954
  202.     ELSE
  203.         IMPORT    NewControl
  204.     ENDIF
  205.  
  206.     IF GENERATING68K THEN
  207.         _SetControlTitle:    OPWORD    $A95F
  208.     ELSE
  209.         IMPORT    SetControlTitle
  210.     ENDIF
  211.  
  212.     IF GENERATING68K THEN
  213.         _GetControlTitle:    OPWORD    $A95E
  214.     ELSE
  215.         IMPORT    GetControlTitle
  216.     ENDIF
  217.  
  218.     IF GENERATING68K THEN
  219.         _GetNewControl:    OPWORD    $A9BE
  220.     ELSE
  221.         IMPORT    GetNewControl
  222.     ENDIF
  223.  
  224.     IF GENERATING68K THEN
  225.         _DisposeControl:    OPWORD    $A955
  226.     ELSE
  227.         IMPORT    DisposeControl
  228.     ENDIF
  229.  
  230.     IF GENERATING68K THEN
  231.         _KillControls:    OPWORD    $A956
  232.     ELSE
  233.         IMPORT    KillControls
  234.     ENDIF
  235.  
  236.     IF GENERATING68K THEN
  237.         _HideControl:    OPWORD    $A958
  238.     ELSE
  239.         IMPORT    HideControl
  240.     ENDIF
  241.  
  242.     IF GENERATING68K THEN
  243.         _ShowControl:    OPWORD    $A957
  244.     ELSE
  245.         IMPORT    ShowControl
  246.     ENDIF
  247.  
  248.     IF GENERATING68K THEN
  249.         _DrawControls:    OPWORD    $A969
  250.     ELSE
  251.         IMPORT    DrawControls
  252.     ENDIF
  253.  
  254.     IF GENERATING68K THEN
  255.         _Draw1Control:    OPWORD    $A96D
  256.     ELSE
  257.         IMPORT    Draw1Control
  258.     ENDIF
  259.  
  260.     IF GENERATING68K THEN
  261.         _HiliteControl:    OPWORD    $A95D
  262.     ELSE
  263.         IMPORT    HiliteControl
  264.     ENDIF
  265.  
  266.     IF GENERATING68K THEN
  267.         _UpdateControls:    OPWORD    $A953
  268.     ELSE
  269.         IMPORT    UpdateControls
  270.     ENDIF
  271.  
  272.     IF GENERATING68K THEN
  273.         _MoveControl:    OPWORD    $A959
  274.     ELSE
  275.         IMPORT    MoveControl
  276.     ENDIF
  277.  
  278.     IF GENERATING68K THEN
  279.         _SizeControl:    OPWORD    $A95C
  280.     ELSE
  281.         IMPORT    SizeControl
  282.     ENDIF
  283.  
  284.     IF GENERATING68K THEN
  285.         _SetControlValue:    OPWORD    $A963
  286.     ELSE
  287.         IMPORT    SetControlValue
  288.     ENDIF
  289.  
  290.     IF GENERATING68K THEN
  291.         _GetControlValue:    OPWORD    $A960
  292.     ELSE
  293.         IMPORT    GetControlValue
  294.     ENDIF
  295.  
  296.     IF GENERATING68K THEN
  297.         _SetControlMinimum:    OPWORD    $A964
  298.     ELSE
  299.         IMPORT    SetControlMinimum
  300.     ENDIF
  301.  
  302.     IF GENERATING68K THEN
  303.         _GetControlMinimum:    OPWORD    $A961
  304.     ELSE
  305.         IMPORT    GetControlMinimum
  306.     ENDIF
  307.  
  308.     IF GENERATING68K THEN
  309.         _SetControlMaximum:    OPWORD    $A965
  310.     ELSE
  311.         IMPORT    SetControlMaximum
  312.     ENDIF
  313.  
  314.     IF GENERATING68K THEN
  315.         _GetControlMaximum:    OPWORD    $A962
  316.     ELSE
  317.         IMPORT    GetControlMaximum
  318.     ENDIF
  319.  
  320.     IF ¬ STRICT_CONTROLS  THEN
  321.     IF GENERATING68K THEN
  322.         _GetAuxiliaryControlRecord:    OPWORD    $AA44
  323.     ELSE
  324.         IMPORT    GetAuxiliaryControlRecord
  325.     ENDIF
  326.  
  327.     ENDIF
  328.     IF GENERATING68K THEN
  329.         _SetControlReference:    OPWORD    $A95B
  330.     ELSE
  331.         IMPORT    SetControlReference
  332.     ENDIF
  333.  
  334.     IF GENERATING68K THEN
  335.         _GetControlReference:    OPWORD    $A95A
  336.     ELSE
  337.         IMPORT    GetControlReference
  338.     ENDIF
  339.  
  340.     IF GENERATING68K THEN
  341.         _SetControlAction:    OPWORD    $A96B
  342.     ELSE
  343.         IMPORT    SetControlAction
  344.     ENDIF
  345.  
  346.     IF GENERATING68K THEN
  347.         _GetControlAction:    OPWORD    $A96A
  348.     ELSE
  349.         IMPORT    GetControlAction
  350.     ENDIF
  351.  
  352.     IF GENERATING68K THEN
  353.         _DragControl:    OPWORD    $A967
  354.     ELSE
  355.         IMPORT    DragControl
  356.     ENDIF
  357.  
  358.     IF GENERATING68K THEN
  359.         _TestControl:    OPWORD    $A966
  360.     ELSE
  361.         IMPORT    TestControl
  362.     ENDIF
  363.  
  364.     IF GENERATING68K THEN
  365.         _FindControl:    OPWORD    $A96C
  366.     ELSE
  367.         IMPORT    FindControl
  368.     ENDIF
  369.  
  370.     IF GENERATING68K THEN
  371.         _SetControlColor:    OPWORD    $AA43
  372.     ELSE
  373.         IMPORT    SetControlColor
  374.     ENDIF
  375.  
  376.     IF GENERATING68K THEN
  377.         _GetControlVariant:    OPWORD    $A809
  378.     ELSE
  379.         IMPORT    GetControlVariant
  380.     ENDIF
  381.  
  382. ;
  383. ;    When using the TrackControl() call when tracking an indicator, the
  384. ;    actionProc parameter (type ControlActionUPP) should be replaced by
  385. ;    a parameter of type DragGrayRgnUPP (defined in Quickdraw.<header>).
  386. ;
  387.     IF GENERATING68K THEN
  388.         _TrackControl:    OPWORD    $A968
  389.     ELSE
  390.         IMPORT    TrackControl
  391.     ENDIF
  392.  
  393.     ENDIF ; __CONTROLS__
  394.